from sort_A import simply_sort

n, m = map(int, input().split())
cords = [list(map(int, input().split())) for i in range(n)]
dots = list(map(int, input().split()))
count = 0

for i in range(n):
        simply_sort(cords[i])

for j in range(len(dots)):
    count = 0
    for i, crd in enumerate(cords):
        if crd[0] <= dots[j] <= crd[1]:
                count += 1

    dots[j] = count

print(" ".join(map(str, dots)))
